using System;
using System.Collections.Generic;
using System.Text;

using Liberty.Application.Security;
using Liberty.Application.Security.Exceptions;

using Peradigm.Framework.Domain.Security;

using Microsoft.VisualStudio.TestTools.UnitTesting;
//using NUnit.Framework.SyntaxHelpers;

using Rhino.Mocks;

namespace Tests.ApplicationTests.Security
{
#if DEBUG
    [TestClass()]
    public class SecurityControllerTests : Object
    {
        #region Constants
        private const string
            USERNAME = "Liberty.CaseDirector",
            PASSWORD = "CaseDirector",
            WRONG_PASSWORD  = "wrongpwd";
            
        #endregion

        #region SetUp and TearDown SecurityControllerTests
        [TestInitialize()]
        public void SetUpSecurityControllerTests()
        {
        }

        [TestCleanup()]
        public void TearDownSecurityControllerTests()
        {
        }
        #endregion

        #region Test Methods
        [TestMethod()]
        public void TestAuthenticateWithValidCredentials()
        {
            SecurityController securityController = new SecurityController();
            User user = securityController.AuthenticateUserWith( USERNAME, PASSWORD );
            Assert.IsNotNull( user, "User object cant be null" );
        }

        [TestMethod()]
        [ExpectedException( typeof( LoginFailedException ) )]
        public void TestAuthenticateWithInValidCredentials()
        {
            SecurityController securityController = new SecurityController();
            securityController.AuthenticateUserWith( USERNAME, WRONG_PASSWORD );
        }
        #endregion

        #region Support Methods
        #endregion

        #region Data Elements
        #endregion

    }
#endif
	
}
